import request from '@/utils/request'

// 查询列表
export function listCourseWare(query) {
    return request({
        url: '/aqsc/courseware/list',
        method: 'get',
        params: query
    })
}

// 查询角色详细
export function getCourseWare(dangerId) {
    return request({
        url: '/aqsc/courseware/' + dangerId,
        method: 'get'
    })
}

// 新增角色
export function addCourseWare(data) {
    return request({
        url: '/aqsc/courseware',
        method: 'post',
        data: data
    })
}

// 修改角色
export function updateCourseWare(data) {
    return request({
        url: '/aqsc/courseware',
        method: 'put',
        data: data
    })
}


//远程服务调用上传
export function uploadFile(data) {
    return request({
        url: '/aqsc/courseware/upload',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}
// 根据id添加上传信息
export function addUri(id, url) {
    return request({
        url: '/aqsc/courseware/addUri',
        params: {
            id: id,
            url: url
        },
        method: 'get'
    })
}

// 删除角色
export function delCourseWare(dangerId) {
    return request({
        url: '/aqsc/courseware/' + dangerId,
        method: 'delete'
    })

}
